home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-22 | 96.4 KB | 3,199 lines |
- Subject: BETA TEST 2 of elm 2.4 Patch #23b
- Summary: This is an official patch for elm 2.4 system. Please apply it.
- Priority: HIGH
-
- THIS IS PART 2 OF A 4 PART PATCH
-
- THIS PATCH IS IN BETA TEST. IT IS SUBJECT TO CHANGE.
- SAVE YOUR ORIGINAL COPY OF ELM SOURCES SO YOU CAN BACK THIS OUT BEFORE
- APPLYING THE OFFICIAL PATCH
-
- Fix: From rn, say "| patch -p -N -d DIR", where DIR is your elm source
- directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- Apply patches 23c, 23d next
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from our:
- archive server.
-
- Syd Weinstein
- elm@DSI.COM
-
- The patches are available from the dsinc archive server
- Send the following message to archive-server@DSI.COM for
- a list of available patches:
-
- Subject: patch list
- send index elm
-
- Index: hdrs/elm.h
- Prereq: 5.9
- *** ../elm2.4/hdrs/elm.h Sat May 8 16:03:17 1993
- --- hdrs/elm.h Tue Aug 10 14:49:33 1993
- ***************
- *** 1,8 ****
-
- ! /* $Id: elm.h,v 5.9 1993/05/08 20:03:12 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! /* $Id: elm.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,27 ----
- *
- *******************************************************************************
- * $Log: elm.h,v $
- + * Revision 5.10 1993/08/10 18:49:32 syd
- + * When an environment variable was given as the tmpdir definition the src
- + * and dest overlapped in expand_env. This made elm produce a garbage
- + * expansion because expand_env cannot cope with overlapping src and
- + * dest. I added a new variable raw_temp_dir to keep src and dest not to
- + * overlap.
- + * From: Jukka Ukkonen <ukkonen@csc.fi>
- + *
- * Revision 5.9 1993/05/08 20:03:12 syd
- * add sleepmsg to list
- *
- ***************
- *** 115,120 ****
- --- 123,129 ----
- char cur_tempfolder[SLEN] = {0};/* name of temp folder open for a mailbox */
- char defaultfile[SLEN] = {0}; /* name of default folder */
- char temp_dir[SLEN] = {0}; /* name of temp directory */
- + char raw_temp_dir[SLEN] = {0}; /* unexpanded name of temp directory */
- char hostname[SLEN] = {0}; /* name of machine we're on*/
- char hostdomain[SLEN] = {0}; /* name of domain we're in */
- char hostfullname[SLEN] = {0}; /* name of FQDN we're in */
-
- Index: hdrs/filter.h
- Prereq: 5.10
- *** ../elm2.4/hdrs/filter.h Sun Jun 6 14:24:47 1993
- --- hdrs/filter.h Tue Aug 3 15:28:44 1993
- ***************
- *** 1,8 ****
-
- ! /* $Id: filter.h,v 5.10 1993/06/06 17:34:40 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! /* $Id: filter.h,v 5.11 1993/08/03 19:28:39 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.11 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,31 ----
- *
- *******************************************************************************
- * $Log: filter.h,v $
- + * Revision 5.11 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.10 1993/06/06 17:34:40 syd
- * remove useless _vbuf definition
- *
- ***************
- *** 68,77 ****
-
- #include "regexp.h"
-
- - #ifdef BSD
- - # undef tolower
- - #endif
- -
- /** define a few handy macros for later use... **/
-
- #define the_same(a,b) (strncmp(a,b,strlen(b)) == 0)
- --- 80,85 ----
-
- Index: hdrs/headers.h
- Prereq: 5.10
- *** ../elm2.4/hdrs/headers.h Sat May 8 16:03:18 1993
- --- hdrs/headers.h Tue Aug 10 16:49:55 1993
- ***************
- *** 1,8 ****
-
- ! /* $Id: headers.h,v 5.10 1993/05/08 20:03:12 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! /* $Id: headers.h,v 5.11 1993/08/10 20:49:40 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.11 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,22 ----
- *
- *******************************************************************************
- * $Log: headers.h,v $
- + * Revision 5.11 1993/08/10 20:49:40 syd
- + * Add raw_temp_dir
- + *
- * Revision 5.10 1993/05/08 20:03:12 syd
- * add sleepmsg to list
- *
- ***************
- *** 115,120 ****
- --- 118,124 ----
- extern char cur_tempfolder[SLEN]; /* name of temp folder open for a mailbox */
- extern char defaultfile[SLEN]; /* name of default folder */
- extern char temp_dir[SLEN]; /* name of temp directory */
- + extern char raw_temp_dir[SLEN]; /* unexpanded name of temp directory */
- extern char hostname[SLEN]; /* name of machine we're on*/
- extern char hostdomain[SLEN]; /* name of domain we're in */
- extern char hostfullname[SLEN]; /* name of FQDN we're in */
-
- Index: hdrs/mcprt.h
- *** ../elm2.4/hdrs/mcprt.h Sat Oct 3 18:35:08 1992
- --- hdrs/mcprt.h Sun Aug 22 22:46:28 1993
- ***************
- *** 48,56 ****
- --- 48,62 ----
- #include <stdio.h>
-
- #ifdef USENLS
- + # ifdef I_STDARG
- + extern int MCprintf(char *fmt, ...);
- + extern int MCfprintf(FILE *fptr, char *fmt, ...);
- + extern int MCsprintf(char *cptr, char *fmt, ...);
- + # else
- extern int MCprintf();
- extern int MCfprintf();
- extern int MCsprintf();
- + # endif
- #endif
-
- #endif
-
- Index: hdrs/mcprtlib.h
- *** ../elm2.4/hdrs/mcprtlib.h Sat Oct 3 18:35:09 1992
- --- hdrs/mcprtlib.h Sun Aug 22 22:48:18 1993
- ***************
- *** 41,47 ****
- 03/20/91 2 schulert Ultrix cc has trouble with void*, so change them to int*
- 01/18/91 3 hamilton #if not rescanned
- 01/12/91 1 schulert conditionally use prototypes
- ! rework to use either varargs or stdargs
- 11/03/90 2 hamilton Alphalpha->Alfalfa & OmegaMail->Poste
- 08/10/90 1 nazgul Initial version
- */
- --- 41,47 ----
- 03/20/91 2 schulert Ultrix cc has trouble with void*, so change them to int*
- 01/18/91 3 hamilton #if not rescanned
- 01/12/91 1 schulert conditionally use prototypes
- ! rework to use either varargs or stdarg
- 11/03/90 2 hamilton Alphalpha->Alfalfa & OmegaMail->Poste
- 08/10/90 1 nazgul Initial version
- */
- ***************
- *** 49,56 ****
- --- 49,61 ----
- /* taken from Xm/lib/VaSimple.h
- currently no one defines MISSING_STDARG_H */
-
- + #ifdef I_STDARG
- + # include <stdarg.h>
- + # define Va_start(a,b) va_start(a,b)
- + #else
- # include <varargs.h>
- # define Va_start(a,b) va_start(a)
- + #endif
-
- #define MCFree 0x0010 /* Reminder to MCPrintFree */
- #define MCCatalog 0x0100 /* Probably came from catalog */
-
- Index: hdrs/ndbz.h
- Prereq: 5.2
- *** ../elm2.4/hdrs/ndbz.h Sat Oct 10 21:47:09 1992
- --- hdrs/ndbz.h Mon Jul 19 22:59:54 1993
- ***************
- *** 1,8 ****
-
- ! /* $Id: ndbz.h,v 5.2 1992/10/11 01:46:35 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! /* $Id: ndbz.h,v 5.3 1993/07/20 02:59:53 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,23 ----
- *
- *******************************************************************************
- * $Log: ndbz.h,v $
- + * Revision 5.3 1993/07/20 02:59:53 syd
- + * Support aliases both on 64 bit and 32 bit machines at the same time.
- + * From: Dan Mosedale <mosedale@genome.stanford.edu>
- + *
- * Revision 5.2 1992/10/11 01:46:35 syd
- * change dbm name to dbz to avoid conflicts with partial call
- * ins from shared librarys, and from mixing code with yp code.
- ***************
- *** 57,63 ****
- * to have a distinctive name for it. Beware, this is just for readability,
- * don't try to change this.
- */
- ! #define of_t long
- #define SOF (sizeof(of_t))
-
- /*
- --- 61,73 ----
- * to have a distinctive name for it. Beware, this is just for readability,
- * don't try to change this.
- */
- !
- ! /*
- ! * Big kludge: this is set up as 32-bit rather than a long so that ndbz db's
- ! * will work across NFS on 64 bit machines as well as 32 bit machines.
- ! */
- !
- ! #define of_t int32
- #define SOF (sizeof(of_t))
-
- /*
-
- Index: hdrs/s_elm.h
- *** ../elm2.4/hdrs/s_elm.h Mon May 31 15:35:18 1993
- --- hdrs/s_elm.h Tue Aug 3 14:58:35 1993
- ***************
- *** 1,4 ****
- ! /* s_elm.h created from s_elm.us by gencat on Mon May 31 15:35:18 EDT 1993 */
-
- #define ElmSet 0x3
- #define ElmYes 0x1
- --- 1,4 ----
- ! /* s_elm.h created from s_elm.us by gencat on Tue Aug 3 14:58:35 EDT 1993 */
-
- #define ElmSet 0x3
- #define ElmYes 0x1
- ***************
- *** 499,505 ****
- #define ElmTooManyWeedHeaders 0x233
- #define ElmTooManyWeedPmalloc 0x234
- #define ElmNoMemDefaultWeed 0x235
- ! #define ElmCantExpandEnvVar 0x236
- #define ElmCouldntMakeTempFileName 0x237
- #define ElmCouldntOpenForWriting 0x238
- #define ElmSureYouWantToRemail 0x239
- --- 499,505 ----
- #define ElmTooManyWeedHeaders 0x233
- #define ElmTooManyWeedPmalloc 0x234
- #define ElmNoMemDefaultWeed 0x235
- ! #define ElmCannotInitErrorExpanding 0x236
- #define ElmCouldntMakeTempFileName 0x237
- #define ElmCouldntOpenForWriting 0x238
- #define ElmSureYouWantToRemail 0x239
-
- Index: hdrs/save_opts.h
- Prereq: 5.8
- *** ../elm2.4/hdrs/save_opts.h Sat May 8 16:02:01 1993
- --- hdrs/save_opts.h Tue Aug 10 14:49:32 1993
- ***************
- *** 1,8 ****
-
- ! /* @(#)$Id: save_opts.h,v 5.8 1993/05/08 18:56:16 syd Exp syd $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! /* @(#)$Id: save_opts.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,30 ----
- *
- *******************************************************************************
- * $Log: save_opts.h,v $
- + * Revision 5.10 1993/08/10 18:49:32 syd
- + * When an environment variable was given as the tmpdir definition the src
- + * and dest overlapped in expand_env. This made elm produce a garbage
- + * expansion because expand_env cannot cope with overlapping src and
- + * dest. I added a new variable raw_temp_dir to keep src and dest not to
- + * overlap.
- + * From: Jukka Ukkonen <ukkonen@csc.fi>
- + *
- + * Revision 5.9 1993/06/12 05:28:06 syd
- + * Missing checkin
- + *
- * Revision 5.8 1993/05/08 18:56:16 syd
- * created a new elmrc variable named "readmsginc". This specifies an
- * increment by which the message count is updated. If this variable is
- ***************
- *** 230,236 ****
- #endif
- {"timeout", -1L,DT_NUM,(char *)&timeout},
- {"titles", -1L,DT_BOL,(char *)&title_messages},
- ! {"tmpdir", -1L,DT_STR,temp_dir},
- {"userlevel", -1L,DT_NUM,(char *)&user_level},
- {"username", -1L,DT_SYN,"fullname"},
- {"usetite", -1L,DT_BOL|FL_AND,(char *)&use_tite},
- --- 241,247 ----
- #endif
- {"timeout", -1L,DT_NUM,(char *)&timeout},
- {"titles", -1L,DT_BOL,(char *)&title_messages},
- ! {"tmpdir", -1L,DT_STR,raw_temp_dir},
- {"userlevel", -1L,DT_NUM,(char *)&user_level},
- {"username", -1L,DT_SYN,"fullname"},
- {"usetite", -1L,DT_BOL|FL_AND,(char *)&use_tite},
-
- Index: lib/Makefile.SH
- Prereq: 5.11
- *** ../elm2.4/lib/Makefile.SH Sun Apr 11 21:51:43 1993
- --- lib/Makefile.SH Tue Aug 3 15:28:46 1993
- ***************
- *** 36,42 ****
-
- echo "Extracting lib/Makefile (with variable substitutions)"
- cat >Makefile <<!GROK!THIS!
- ! # $Id: Makefile.SH,v 5.11 1993/04/12 01:51:42 syd Exp $
- #
- # Makefile for the ELM mail program.
- #
- --- 36,42 ----
-
- echo "Extracting lib/Makefile (with variable substitutions)"
- cat >Makefile <<!GROK!THIS!
- ! # $Id: Makefile.SH,v 5.15 1993/08/03 19:28:39 syd Exp $
- #
- # Makefile for the ELM mail program.
- #
- ***************
- *** 49,54 ****
- --- 49,88 ----
- # dsinc!elm
- #
- # $Log: Makefile.SH,v $
- + # Revision 5.15 1993/08/03 19:28:39 syd
- + # Elm tries to replace the system toupper() and tolower() on current
- + # BSD systems, which is unnecessary. Even worse, the replacements
- + # collide during linking with routines in isctype.o. This patch adds
- + # a Configure test to determine whether replacements are really needed
- + # (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + # globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + # there. Inclusion of <ctype.h> was removed from *all* the individual
- + # files, and the toupper() and tolower() routines in lib/opt_utils.c
- + # were dropped.
- + # From: chip@chinacat.unicom.com (Chip Rosenthal)
- + #
- + # Revision 5.14 1993/08/03 19:17:33 syd
- + # Implement new timezone handling. New file lib/get_tz.c with new timezone
- + # routines. Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
- + # definitions. Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
- + # definitions. Updated Configure. Modified lib/getarpdate.c and
- + # lib/strftime.c to use new timezone routines.
- + #
- + # From: chip@chinacat.unicom.com (Chip Rosenthal)
- + #
- + # Revision 5.13 1993/08/02 18:14:35 syd
- + # add missing references for mcprt.c/mcprtlib.c to defs.h
- + # From: Syd
- + #
- + # Revision 5.12 1993/06/10 03:02:46 syd
- + # break_down_tolist() tried to blindly split address lists at "," which
- + # caused bogus results with addreses that had a comma inside a comment
- + # or quoted text, such as "user@domain (Last, First)". This patch steps
- + # through the address in quanta of RFC-822 tokens when searching for a
- + # delimiting comma. It also adds "rfc822_toklen()" to the library to
- + # get that length.
- + # From: chip@chinacat.unicom.com (Chip Rosenthal)
- + #
- # Revision 5.11 1993/04/12 01:51:42 syd
- # Added safe_malloc(), safe_realloc(), and safe_strdup(). They
- # will be used in the new elmalias utility.
- ***************
- *** 162,167 ****
- --- 196,202 ----
- getarpdate.c \
- getfullnam.c \
- getword.c \
- + get_tz.c \
- header_cmp.c \
- in_list.c \
- in_string.c \
- ***************
- *** 182,187 ****
- --- 217,223 ----
- qstrings.c \
- remfirstwd.c \
- reverse.c \
- + rfc822tlen.c \
- safemalloc.c \
- shiftlower.c \
- strfcpy.c \
- ***************
- *** 207,212 ****
- --- 243,249 ----
- expand.o \
- figadrssee.o \
- gcos_name.o \
- + get_tz.o \
- getaddrfrm.o \
- getarpdate.o \
- getfullnam.o \
- ***************
- *** 231,236 ****
- --- 268,274 ----
- realfrom.o \
- remfirstwd.o \
- reverse.o \
- + rfc822tlen.o \
- safemalloc.o \
- shiftlower.o \
- strfcpy.o \
- ***************
- *** 280,285 ****
- --- 318,324 ----
- # Dependencies of C object files
- add_site.o: $(INCLDIR)/headers.h
- addrmchusr.o: $(INCLDIR)/headers.h
- + atonum.o: $(INCLDIR)/defs.h
- mk_aliases.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
- aliasdb.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
- mk_lockname.o: $(INCLDIR)/headers.h
- ***************
- *** 291,296 ****
- --- 330,336 ----
- expand.o: $(INCLDIR)/defs.h $(INCLDIR)/s_elmrc.h
- figadrssee.o: $(INCLDIR)/headers.h
- gcos_name.o: $(INCLDIR)/headers.h
- + get_tz.o: $(INCLDIR)/defs.h
- getaddrfrm.o: $(INCLDIR)/headers.h
- getarpdate.o: $(INCLDIR)/headers.h
- getfullnam.o: $(INCLDIR)/headers.h
- ***************
- *** 302,309 ****
- ldstate.o: $(INCLDIR)/defs.h
- len_next.o: ../config.h
- mail_gets.o: ../config.h
- ! mcprt.o: $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h
- ! mcprtlib.o: $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h
- move_left.o: $(INCLDIR)/headers.h
- msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
- ndbz.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
- --- 342,349 ----
- ldstate.o: $(INCLDIR)/defs.h
- len_next.o: ../config.h
- mail_gets.o: ../config.h
- ! mcprt.o: $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h $(INCLDIR)/defs.h
- ! mcprtlib.o: $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h $(INCLDIR)/defs.h
- move_left.o: $(INCLDIR)/headers.h
- msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
- ndbz.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
-
- Index: lib/aliasdb.c
- Prereq: 5.3
- *** ../elm2.4/lib/aliasdb.c Tue Apr 20 21:40:16 1993
- --- lib/aliasdb.c Tue Aug 3 15:28:46 1993
- ***************
- *** 1,5 ****
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
- +
- + static char rcsid[] = "@(#)$Id: aliasdb.c,v 5.7 1993/08/03 19:28:39 syd Exp $";
- +
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 11,16 ****
- --- 14,46 ----
- *
- *******************************************************************************
- * $Log: aliasdb.c,v $
- + * Revision 5.7 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- + * Revision 5.6 1993/07/20 02:59:53 syd
- + * Support aliases both on 64 bit and 32 bit machines at the same time.
- + * From: Dan Mosedale <mosedale@genome.stanford.edu>
- + *
- + * Revision 5.5 1993/06/10 03:12:10 syd
- + * Add missing rcs id lines
- + * From: Syd
- + *
- + * Revision 5.4 1993/06/10 02:58:26 syd
- + * Correct problem in fetch_alias() with alias record fixup that caused
- + * core dump on machines with pointers larger than int. This problem
- + * was reported on comp.mail.elm by Richard Eckman and Jim Brown. Simplify
- + * get_one_alias() by having it use fetch_alias().
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.3 1993/04/21 01:40:12 syd
- * add seekset define
- *
- ***************
- *** 35,41 ****
- **/
-
- #include "headers.h"
- - #include <ctype.h>
- #include "ndbz.h"
-
- #ifndef SEEK_SET
- --- 65,70 ----
- ***************
- *** 46,53 ****
-
- #ifdef BSD
- # include <sys/file.h>
- - # undef tolower
- - # undef toupper
- #endif
-
- /* byte-ordering stuff */
- --- 75,80 ----
- ***************
- *** 74,82 ****
- return(out.o);
- }
-
- ! read_one_alias(db, ar)
- DBZ *db;
- ! struct alias_rec *ar;
- {
- /*
- * Read an alias (name, address, etc.) from the data file
- --- 101,109 ----
- return(out.o);
- }
-
- ! read_one_alias(db, adr)
- DBZ *db;
- ! struct alias_disk_rec *adr;
- {
- /*
- * Read an alias (name, address, etc.) from the data file
- ***************
- *** 87,103 ****
- if (data_file == NULL)
- return(0); /* no alias file, but hash exists, error condition */
-
- ! if (fread((char *) ar, sizeof(struct alias_rec), 1, data_file) <= 0)
- ! return(0);
- !
- ! ar->status = (int) MAPIN(ar->status);
- ! ar->alias = (char *) MAPIN(ar->alias);
- ! ar->last_name = (char *) MAPIN(ar->last_name);
- ! ar->name = (char *) MAPIN(ar->name);
- ! ar->comment = (char *) MAPIN(ar->comment);
- ! ar->address = (char *) MAPIN(ar->address);
- ! ar->type = (int) MAPIN(ar->type);
- ! ar->length = (long) MAPIN(ar->length);
-
- return(1);
- }
- --- 114,131 ----
- if (data_file == NULL)
- return(0); /* no alias file, but hash exists, error condition */
-
- ! if (fread((char *) adr, sizeof(struct alias_disk_rec), 1, data_file)
- ! <= 0)
- ! return(0);
- !
- ! adr->status = (int32) MAPIN(adr->status);
- ! adr->alias = (int32) MAPIN(adr->alias);
- ! adr->last_name = (int32) MAPIN(adr->last_name);
- ! adr->name = (int32) MAPIN(adr->name);
- ! adr->comment = (int32) MAPIN(adr->comment);
- ! adr->address = (int32) MAPIN(adr->address);
- ! adr->type = (int32) MAPIN(adr->type);
- ! adr->length = (int32) MAPIN(adr->length);
-
- return(1);
- }
- ***************
- *** 122,128 ****
- char *alias;
- {
- datum key, val;
- ! struct alias_rec arec;
- long pos;
- register struct alias_rec *ar;
- register char *buf, *s;
- --- 150,156 ----
- char *alias;
- {
- datum key, val;
- ! struct alias_disk_rec adrec;
- long pos;
- register struct alias_rec *ar;
- register char *buf, *s;
- ***************
- *** 159,194 ****
- /*
- * Move to the position of the selected alias record.
- */
- ! pos = *((long *)(val.dptr)) - sizeof(struct alias_rec);
- if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
- return (struct alias_rec *)NULL;
-
- }
-
- /*
- * We are now positioned at the alias record we want. Pull it in.
- */
- ! if (!read_one_alias(db, &arec))
- return (struct alias_rec *)NULL;
-
- /*
- * Allocate space to hold the alias record and data content.
- */
- ar = (struct alias_rec *)
- ! safe_malloc(sizeof(struct alias_rec) + arec.length);
- ! *ar = arec;
- buf = (char *)ar + sizeof(struct alias_rec);
-
- /*
- ! * Read in the data content and fixup pointers in the alias record.
- */
- if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
- return (struct alias_rec *)NULL;
- - ar->alias += (int) buf;
- - ar->last_name += (int) buf;
- - ar->name += (int) buf;
- - ar->comment += (int) buf;
- - ar->address += (int) buf;
-
- return ar;
- }
- --- 187,241 ----
- /*
- * Move to the position of the selected alias record.
- */
- ! pos = *((long *)(val.dptr)) - sizeof(struct alias_disk_rec);
- if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
- return (struct alias_rec *)NULL;
-
- }
-
- /*
- + * Each alias in the data file is stored as a (struct alias_rec)
- + * followed by text information for that alias record. The
- + * size of the following text information is specified by `length',
- + * and the value of the other members of the structure are actually
- + * offsets into that buffer space. So, to load in an alias we
- + * need to: (1) read the alias record, (2) see how long the data
- + * buffer is and pull it in, and (3) fixup the pointers in the
- + * alias record so they point into the data buffer.
- + */
- +
- + /*
- * We are now positioned at the alias record we want. Pull it in.
- */
- ! if (!read_one_alias(db, &adrec))
- return (struct alias_rec *)NULL;
-
- /*
- * Allocate space to hold the alias record and data content.
- */
- +
- ar = (struct alias_rec *)
- ! safe_malloc(sizeof(struct alias_rec) + (size_t)adrec.length);
- !
- buf = (char *)ar + sizeof(struct alias_rec);
-
- + /*
- + * Fixup pointers in the alias record.
- + */
- + ar->status = (int)adrec.status;
- + ar->alias = (char *) ((size_t) adrec.alias + (size_t) buf);
- + ar->last_name = (char *) ((size_t) adrec.last_name + (size_t) buf);
- + ar->name = (char *) ((size_t) adrec.name + (size_t) buf);
- + ar->comment = (char *) ((size_t) adrec.comment + (size_t) buf);
- + ar->address = (char *) ((size_t) adrec.address + (size_t) buf);
- + ar->type = (int)adrec.type;
- + ar->length = (size_t)adrec.length;
- +
- /*
- ! * Read in the data content
- */
- if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
- return (struct alias_rec *)NULL;
-
- return ar;
- }
-
- Index: lib/atonum.c
- Prereq: 5.1
- *** ../elm2.4/lib/atonum.c Mon Jan 18 23:46:39 1993
- --- lib/atonum.c Tue Aug 3 15:28:47 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.1 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,25 ****
- *
- *******************************************************************************
- * $Log: atonum.c,v $
- * Revision 5.1 1993/01/19 04:46:21 syd
- * Initial Checkin
- *
- *
- ******************************************************************************/
-
- ! #include <ctype.h>
-
- /*
- * This is similar to atoi(), but it complains if the string
- --- 13,37 ----
- *
- *******************************************************************************
- * $Log: atonum.c,v $
- + * Revision 5.2 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.1 1993/01/19 04:46:21 syd
- * Initial Checkin
- *
- *
- ******************************************************************************/
-
- ! #include "defs.h"
-
- /*
- * This is similar to atoi(), but it complains if the string
-
- Index: lib/can_access.c
- Prereq: 5.6
- *** ../elm2.4/lib/can_access.c Thu May 13 23:52:11 1993
- --- lib/can_access.c Sun Aug 22 22:46:07 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.6 1993/05/14 03:52:10 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.8 1993/08/23 02:46:07 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,35 ----
- *
- *******************************************************************************
- * $Log: can_access.c,v $
- + * Revision 5.8 1993/08/23 02:46:07 syd
- + * Don't declare _exit() if <unistd.h> already did it.
- + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
- + *
- + * Revision 5.7 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.6 1993/05/14 03:52:10 syd
- * When compiled on a POSIX host PL22 failed checking whether the file is
- * readable and a regular file or not. There was one `!' missing in the
- ***************
- *** 48,60 ****
-
- #include "headers.h"
- #include <sys/stat.h>
- - #include <ctype.h>
- #include <errno.h>
-
- #ifdef BSD
- # include <sys/wait.h>
- #endif
-
- extern int errno; /* system error number */
-
- int
- --- 64,79 ----
-
- #include "headers.h"
- #include <sys/stat.h>
- #include <errno.h>
-
- #ifdef BSD
- # include <sys/wait.h>
- #endif
-
- + #ifndef I_UNISTD
- + void _exit();
- + #endif
- +
- extern int errno; /* system error number */
-
- int
- ***************
- *** 66,72 ****
-
- int the_stat = 0, pid, w;
- struct stat stat_buf;
- - void _exit();
- #if defined(BSD) && !defined(WEXITSTATUS)
- union wait status;
- #else
- --- 85,90 ----
-
- Index: lib/can_open.c
- Prereq: 5.2
- *** ../elm2.4/lib/can_open.c Fri Dec 11 20:29:27 1992
- --- lib/can_open.c Sun Aug 22 22:46:08 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.2 1992/12/12 01:29:26 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.4 1993/08/23 02:46:07 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,35 ----
- *
- *******************************************************************************
- * $Log: can_open.c,v $
- + * Revision 5.4 1993/08/23 02:46:07 syd
- + * Don't declare _exit() if <unistd.h> already did it.
- + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
- + *
- + * Revision 5.3 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.2 1992/12/12 01:29:26 syd
- * Fix double inclusion of sys/types.h
- * From: Tom Moore <tmoore@wnas.DaytonOH.NCR.COM>
- ***************
- *** 30,42 ****
-
- #include "headers.h"
- #include <sys/stat.h>
- - #include <ctype.h>
- #include <errno.h>
-
- #ifdef BSD
- # include <sys/wait.h>
- #endif
-
- extern int errno; /* system error number */
-
- int
- --- 46,61 ----
-
- #include "headers.h"
- #include <sys/stat.h>
- #include <errno.h>
-
- #ifdef BSD
- # include <sys/wait.h>
- #endif
-
- + #ifndef I_UNISTD
- + void _exit();
- + #endif
- +
- extern int errno; /* system error number */
-
- int
- ***************
- *** 49,55 ****
-
- FILE *fd;
- int the_stat = 0, pid, w, preexisted = 0;
- - void _exit();
- #if defined(BSD) && !defined(WEXITSTATUS)
- union wait status;
- #else
- --- 68,73 ----
-
- Index: lib/date_util.c
- Prereq: 5.2
- *** ../elm2.4/lib/date_util.c Wed Jan 27 15:54:25 1993
- --- lib/date_util.c Tue Aug 3 15:28:48 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.2 1993/01/27 20:54:24 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: date_util.c,v $
- + * Revision 5.3 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.2 1993/01/27 20:54:24 syd
- * There is a small bug in this routine in Chip's PL21 patch. The code
- * calls atonum to convert the 4 digit timezone field. However this field
- ***************
- *** 27,33 ****
- ******************************************************************************/
-
- #include "headers.h"
- - #include <ctype.h>
-
- /*
- * Date processing functions:
- --- 39,44 ----
-
- Index: lib/figadrssee.c
- Prereq: 5.2
- *** ../elm2.4/lib/figadrssee.c Wed Feb 3 11:25:46 1993
- --- lib/figadrssee.c Sat Jun 12 01:33:39 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.2 1993/02/03 16:25:45 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.3 1993/06/12 05:33:32 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,23 ----
- *
- *******************************************************************************
- * $Log: figadrssee.c,v $
- + * Revision 5.3 1993/06/12 05:33:32 syd
- + * Remove useless auto
- + * From: Syd
- + *
- * Revision 5.2 1993/02/03 16:25:45 syd
- * Adresses with double quoted strings that contains comma was parsed
- * wrongly by break_down_tolist() and figure_out_addressee().
- ***************
- *** 42,48 ****
- **/
-
- char *address, *bufptr, mybuf[SLEN];
- - register int index2 = 0;
-
- if (equal(mail_to, username)) return; /* can't be better! */
-
- --- 46,51 ----
-
- Index: lib/gcos_name.c
- Prereq: 5.2
- *** ../elm2.4/lib/gcos_name.c Tue Jan 19 22:02:33 1993
- --- lib/gcos_name.c Tue Aug 3 15:28:49 1993
- ***************
- *** 1,7 ****
- ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.2 1993/01/20 03:02:19 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,7 ----
- ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: gcos_name.c,v $
- + * Revision 5.3 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.2 1993/01/20 03:02:19 syd
- * Move string declarations to defs.h
- * From: Syd
- ***************
- *** 28,39 ****
- **/
-
- #include "headers.h"
- - #include <ctype.h>
- -
- - #ifdef BSD
- - #undef tolower
- - #undef toupper
- - #endif
-
- char *
- gcos_name(gcos_field, logname)
- --- 40,45 ----
-
- Index: lib/get_tz.c
- *** /dev/null Sun Aug 22 23:14:45 1993
- --- lib/get_tz.c Tue Aug 10 14:57:50 1993
- ***************
- *** 0 ****
- --- 1,298 ----
- +
- + static char rcsid[] = "@(#)$Id: get_tz.c,v 5.1 1993/08/10 18:56:53 syd Exp $";
- +
- + /*******************************************************************************
- + * The Elm Mail System - $Revision: 5.1 $ $State: Exp $
- + *
- + * Copyright (c) 1992, 1993 USENET Community Trust
- + *******************************************************************************
- + * Bug reports, patches, comments, suggestions should be sent to:
- + *
- + * Syd Weinstein, Elm Coordinator
- + * elm@DSI.COM dsinc!elm
- + *
- + *******************************************************************************
- + * $Log: get_tz.c,v $
- + * Revision 5.1 1993/08/10 18:56:53 syd
- + * Initial Checkin
- + *
- + *
- + ******************************************************************************/
- +
- + /*
- + * get_tz - Site-specific timezone handling.
- + *
- + * get_tz_mins(tm) - Return timezone adjustment in minutes west of GMT.
- + * get_tz_name(tm) - Return timezone name.
- + *
- + * These procedures return timezone infomation for the time specified by "tm".
- + * If "tm" is NULL, then the local, current timezone info are returned.
- + *
- + * On some systems, regardless of the "tm" value, the local timezone
- + * values are returned.
- + *
- + * On some systems, when passing a non-NULL "tm" value, a call to "tzset()"
- + * must be performed prior to invoking these routines to obtain proper
- + * timezone information. Note that some systems will implicitly call
- + * "tzset()" through other routines, such as "localtime()". On such
- + * systems an explicit "tzset()" is not required if the "tm" value was
- + * obtained through a routine that does the implicit setup.
- + *
- + * The task of discovering timezone info is a horrid mess because so many
- + * systems have different notions about how to do it. The goal of these
- + * routines is to encapsulate the system dependancies here. Two definitions,
- + * TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx must be enabled as appropriate
- + * for this system. Exactly _one_ definition from each group must be
- + * specified. The available choices are:
- + *
- + * TZMINS_USE_xxxxxx specifies how to get timezone offset.
- + *
- + * TZMINS_USE_TM_TZADJ use (struct tm*)->tm_tzadj
- + * TZMINS_USE_TM_GMTOFF use (struct tm*)->tm_gmtoff
- + * TZMINS_USE_TZAZ_GLOBAL use "timezone, altzone" externals
- + * TZMINS_USE_TZ_GLOBAL use "timezone" external
- + * TZMINS_USE_FTIME use ftime() function
- + * TZMINS_USE_TIMEOFDAY use gettimeofday() function
- + *
- + * TZNAME_USE_xxxxxx specifies how to get timezone name.
- + *
- + * TZNAME_USE_TM_NAME use (struct tm *)->tm_name
- + * TZNAME_USE_TM_ZONE use (struct tm *)->tm_zone
- + * TZNAME_USE_TZNAME use "tzname[]" external
- + * TZNAME_USE_TIMEZONE use timezone() function
- + *
- + * The TZMINS_HANDLING and TZNAME_HANDLING definitions are just used
- + * to verify the configurations were setup correctly. They force
- + * compiler warnings and/or errors in the event of a configuration problem.
- + */
- +
- + #include "defs.h"
- +
- + #ifdef I_TIME
- + # include <time.h>
- + #endif
- + #ifdef I_SYSTIME
- + # include <sys/time.h>
- + #endif
- + #ifdef TZMINS_USE_FTIME
- + # include <sys/timeb.h>
- + #endif
- +
- + #ifndef _POSIX_SOURCE
- + extern struct tm *localtime();
- + extern time_t time();
- + #endif
- +
- + /****************************************************************************/
- +
- + int get_tz_mins(tm)
- + struct tm *tm;
- + {
- +
- + if (tm == 0) {
- + time_t t;
- + (void) time(&t);
- + tm = localtime(&t);
- + }
- +
- + #ifdef TZMINS_USE_TM_TZADJ
- + #define TZMINS_HANDLING 1
- + /*
- + * This system maintains the timezone offset in the (struct tm)
- + * as a number of _seconds_ west of GMT.
- + */
- + return (int)(tm->tm_tzadj / 60);
- + #endif
- +
- + #ifdef TZMINS_USE_TM_GMTOFF
- + #define TZMINS_HANDLING 2
- + /*
- + * This system maintains the timezone offset in the (struct tm)
- + * as a number of _seconds_ _east_ of GMT. Since this is an
- + * easterly pointing offset, we need to flip the sign to go the
- + * other direction.
- + */
- + return (int)(-tm->tm_gmtoff / 60);
- + #endif
- +
- + #ifdef TZMINS_USE_TZAZ_GLOBAL
- + #define TZMINS_HANDLING 3
- + /*
- + * This system maintains timezone offsets in global variables
- + * as a number of _seconds_ west of GMT. There are two globals,
- + * one for when DST is in effect and one for when it is not,
- + * and we need to select the correct one.
- + */
- + {
- + extern long altzone, timezone;
- + return (int)((tm->tm_isdst ? altzone : timezone) / 60);
- + }
- + #endif
- +
- + #ifdef TZMINS_USE_TZ_GLOBAL
- + #define TZMINS_HANDLING 4
- + /*
- + * This system maintains the timezone offset in a global variable as
- + * a number of _seconds_ west of GMT. We need to correct this value
- + * if DST is in effect. Note that the global "daylight" indicates
- + * that DST applies to this site and NOT necessarily that the DST
- + * correction needs to be applied right now. Be careful -- some
- + * systems have a "timezone()" procedure and this method will return
- + * the address of that procedure rather than a timezone offset!
- + */
- + {
- + extern long timezone;
- + extern int daylight;
- + return (int)(timezone/60) -
- + ((daylight && tm->tm_isdst) ? 60 : 0);
- + }
- + #endif
- +
- + #ifdef TZMINS_USE_TIMEOFDAY
- + #define TZMINS_HANDLING 5
- + /*
- + * This system uses gettimeofday() to obtain the timezone
- + * information as minutes west of GMT. The returned value will
- + * not be corrected for DST (unless you are unlucky enough to
- + * own a Unix written by some unmentionable vendor), so we will
- + * need to account for that. Be careful -- some systems that
- + * have this procedure depreciate its use for timezone information
- + * and recommend it only for the high-resolution time information.
- + * On these systems the timezone info may be some kernel default
- + * or even garbage.
- + */
- + {
- + struct timeval tv;
- + struct timezone tz;
- + (void) gettimeofday(&tv, &tz);
- + #ifdef AIX
- + return tz.tz_minuteswest;
- + #else
- + return tz.tz_minuteswest -
- + (tm->tm_isdst && tz.tz_dsttime != DST_NONE ? 60 : 0);
- + #endif
- + }
- + #endif
- +
- + #ifdef TZMINS_USE_FTIME
- + #define TZMINS_HANDLING 6
- + /*
- + * This system uses ftime() to obtain the timezone information
- + * as minutes west of GMT. The returned value will not be
- + * corrected for DST, so we will need to account for that. Be
- + * careful -- some systems that have this procedure depreciate
- + * its use for timezone information and recommend it only for
- + * the high-resolution time information. On these systems the
- + * timezone info may be some kernel default or even garbage.
- + */
- + {
- + struct timeb tb;
- + (void) ftime(&tb);
- + return tb.timezone - (tm->tm_isdst ? 60 : 0);
- + }
- + #endif
- +
- + #ifndef TZMINS_HANDLING
- + /* Force a compile error if the timezone config is wrong. */
- + no_tzmins_handling_defined(TZMINS_HANDLING);
- + #endif
- + }
- +
- + /****************************************************************************/
- +
- + char *get_tz_name(tm)
- + struct tm *tm;
- + {
- +
- + if (tm == 0) {
- + time_t t;
- + (void) time(&t);
- + tm = localtime(&t);
- + }
- +
- + #ifdef TZNAME_USE_TM_NAME
- + #define TZNAME_HANDLING 1
- + /*
- + * This system maintains the timezone name in the (struct tm).
- + */
- + return tm->tm_name;
- + #endif
- +
- + #ifdef TZNAME_USE_TM_ZONE
- + #define TZNAME_HANDLING 2
- + /*
- + * This system maintains the timezone name in the (struct tm).
- + */
- + return tm->tm_zone;
- + #endif
- +
- + #ifdef TZNAME_USE_TZNAME
- + #define TZNAME_HANDLING 3
- + /*
- + * This system maintains a global array that contains two timezone
- + * names, one for when DST is in effect and one for when it is not.
- + * We simply need to pick the right one.
- + */
- + {
- + extern char *tzname[];
- + return tzname[tm->tm_isdst];
- + }
- + #endif
- +
- + #ifdef TZNAME_USE_TIMEZONE
- + #define TZNAME_HANDLING 4
- + /*
- + * This system provides a timezone() procedure to get a timezone
- + * name. Be careful -- some systems have this procedure but
- + * depreciate its use, and in some cases it is outright broke.
- + */
- + {
- + extern char *timezone();
- + return timezone(get_tz_mins(tm), tm->tm_isdst);
- + }
- + #endif
- +
- + #ifndef TZNAME_HANDLING
- + /* Force a compile error if the timezone config is wrong. */
- + no_tzname_handling_defined(TZNAME_HANDLING);
- + #endif
- + }
- +
- + /****************************************************************************/
- +
- + #ifdef _TEST
- +
- + /*
- + * It would be best to futz around with the TZ setting when running this
- + * test. In all cases, the "null" and the "localtime()" results should
- + * be identical, and the "gmtime()" results should indicate "GMT 0"
- + * regardless of TZ setting. Here are a few possible TZ settings you
- + * can try, and the result you should expect.
- + *
- + * TZ=GMT always GMT 0
- + * TZ=CST6CDT CST 360 or CDT 300, depending upon time of year
- + * TZ=EST5EDT EST 300 or EDT 240, depending upon time of year
- + * TZ=EST5EDT;0,364 always EDT 240
- + * TZ=EST5EDT;0,0 always EST 300
- + *
- + * Oh...this all assumes your system supports TZ. :-)
- + */
- +
- + main()
- + {
- + time_t t;
- + struct tm *tm;
- + static char f[] = "using %s tm struct - name=\"%s\" mins_west=\"%d\"\n";
- +
- + (void) time(&t);
- + tm = (struct tm *)0;
- + printf(f, "null", get_tz_name(tm), get_tz_mins(tm));
- + tm = localtime(&t);
- + printf(f, "localtime()", get_tz_name(tm), get_tz_mins(tm));
- + tm = gmtime(&t);
- + printf(f, "gmtime()", get_tz_name(tm), get_tz_mins(tm));
- + exit(0);
- + }
- +
- + #endif /*_TEST*/
- +
-
- Index: lib/getaddrfrm.c
- Prereq: 5.3
- *** ../elm2.4/lib/getaddrfrm.c Sun May 16 16:55:52 1993
- --- lib/getaddrfrm.c Tue Aug 3 15:28:49 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.3 1993/05/16 20:55:52 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,31 ----
- *
- *******************************************************************************
- * $Log: getaddrfrm.c,v $
- + * Revision 5.4 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.3 1993/05/16 20:55:52 syd
- * Fix bug where text following "<" within double-quote delimited comment
- * is taken as an address.
- ***************
- *** 34,40 ****
- **/
-
- #include "headers.h"
- - #include <ctype.h>
-
- #ifdef USE_EMBEDDED_ADDRESSES
-
- --- 46,51 ----
-
- Index: lib/getarpdate.c
- Prereq: 5.8
- *** ../elm2.4/lib/getarpdate.c Sat May 8 15:22:46 1993
- --- lib/getarpdate.c Tue Aug 3 15:20:59 1993
- ***************
- *** 1,7 ****
- ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.8 1993/05/08 19:22:46 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,7 ----
- ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.9 1993/08/03 19:17:33 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 13,18 ****
- --- 13,27 ----
- *
- *******************************************************************************
- * $Log: getarpdate.c,v $
- + * Revision 5.9 1993/08/03 19:17:33 syd
- + * Implement new timezone handling. New file lib/get_tz.c with new timezone
- + * routines. Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
- + * definitions. Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
- + * definitions. Updated Configure. Modified lib/getarpdate.c and
- + * lib/strftime.c to use new timezone routines.
- + *
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.8 1993/05/08 19:22:46 syd
- * On the DEC Alpha, OSF/1 the following change made things happy.
- * From: dave@opus.csd.uwm.edu (Dave Rasmussen)
- ***************
- *** 49,58 ****
- *
- ******************************************************************************/
-
- - /**
- -
- - **/
- -
- #include "headers.h"
-
- #ifdef I_TIME
- --- 58,63 ----
- ***************
- *** 61,75 ****
- #ifdef I_SYSTIME
- # include <sys/time.h>
- #endif
- - #ifdef BSD
- - # include <sys/timeb.h>
- - #endif
- -
- - #include <ctype.h>
-
- #ifndef _POSIX_SOURCE
- extern struct tm *localtime();
- - extern struct tm *gmtime();
- extern time_t time();
- #endif
-
- --- 66,74 ----
- ***************
- *** 79,93 ****
- static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
-
- ! #ifdef TZNAME
- ! extern char *tzname[];
- ! #else
- ! char *timezone();
- ! #endif
- !
- ! #ifdef _AIX370
- ! #undef ALTCHECK
- ! #endif /* _AIX370 */
-
- char *
- get_arpa_date()
- --- 78,85 ----
- static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
-
- ! extern int get_tz_mins();
- ! extern char *get_tz_name();
-
- char *
- get_arpa_date()
- ***************
- *** 100,190 ****
- **/
-
- static char buffer[SLEN]; /* static character buffer */
- ! struct tm *the_time; /* Time structure, see CTIME(3C) */
- ! time_t junk; /* time in seconds.... */
- long tzmin; /* number of minutes off gmt */
- char *tzsign; /* + or - gmt */
- !
- ! #if !defined(TZNAME) || defined(_AIX)
- ! # ifndef TZ_MINUTESWEST
- ! struct timeb loc_time;
- !
- ! junk = time((time_t *) 0);
- ! ftime(&loc_time);
- ! # else /* TZ_MINUTESWEST */
- ! struct timeval time_val;
- ! struct timezone time_zone;
- !
- ! gettimeofday(&time_val, &time_zone);
- ! junk = time_val.tv_sec;
- ! # endif /* TZ_MINUTESWEST */
- !
- ! #else /* TZNAME */
- ! # ifndef __osf__
- ! extern time_t timezone;
- ! # endif /* __osf__ */
- ! # ifdef ALTCHECK
- ! extern time_t altzone;
- ! # endif
- !
- ! junk = time((time_t *) 0); /* this must be here for it to work! */
- ! #endif /* TZNAME */
- !
- ! the_time = localtime(&junk);
- ! if (the_time->tm_year < 100)
- ! the_time->tm_year += 1900;
- ! #if !defined(TZNAME) || defined(_AIX)
- ! # ifdef TZ_MINUTESWEST
- ! # ifndef AIX
- ! if (the_time->tm_isdst && time_zone.tz_dsttime != DST_NONE)
- ! tzmin = - (time_zone.tz_minuteswest - 60);
- ! else
- ! # endif /* AIX */
- ! tzmin = - time_zone.tz_minuteswest;
- ! # else /* TZ_MINUTESWEST */
- ! tzmin = the_time->tm_gmtoff / 60;
- ! # endif /* TZ_MINUTESWEST */
- ! #else /* TZNAME */
- ! # ifdef ALTCHECK
- ! if (the_time->tm_isdst)
- ! tzmin = - (altzone / 60);
- ! else
- ! tzmin = - (timezone / 60);
- ! # else /* ALTCHECK */
- ! tzmin = - (timezone / 60);
- ! # endif /* ALTCHECK */
- ! #endif /* TZNAME */
-
- ! if (tzmin >= 0)
- tzsign = "+";
- ! else {
- tzsign = "-";
- tzmin = -tzmin;
- }
- -
- sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
- ! arpa_dayname[the_time->tm_wday],
- ! the_time->tm_mday,
- ! arpa_monname[the_time->tm_mon], the_time->tm_year,
- ! the_time->tm_hour, the_time->tm_min, the_time->tm_sec,
- ! tzsign, tzmin / 60, tzmin % 60,
- ! #if !defined(TZNAME) || defined(_AIX)
- ! #ifdef TZ_MINUTESWEST
- ! # ifdef GOULD_NP1
- ! the_time->tm_zone);
- ! # else
- ! # ifndef _AIX
- ! timezone(time_zone.tz_minuteswest, the_time->tm_isdst));
- ! # else /* AIX has tzname */
- ! tzname[the_time->tm_isdst]);
- ! # endif
- ! # endif
- ! #else
- ! timezone(loc_time.timezone, the_time->tm_isdst));
- ! #endif
- ! #else
- ! tzname[the_time->tm_isdst]);
- ! #endif
-
- ! return( (char *) buffer);
- }
- --- 92,118 ----
- **/
-
- static char buffer[SLEN]; /* static character buffer */
- ! time_t curr_time; /* time in seconds.... */
- ! struct tm *curr_tm; /* Time structure, see CTIME(3C) */
- long tzmin; /* number of minutes off gmt */
- char *tzsign; /* + or - gmt */
- ! int year; /* current year - with century */
-
- ! (void) time(&curr_time);
- ! curr_tm = localtime(&curr_time);
- ! if ((year = curr_tm->tm_year) < 100)
- ! year += 1900;
- ! if ((tzmin = -get_tz_mins(curr_tm)) >= 0) {
- tzsign = "+";
- ! } else {
- tzsign = "-";
- tzmin = -tzmin;
- }
- sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
- ! arpa_dayname[curr_tm->tm_wday],
- ! curr_tm->tm_mday, arpa_monname[curr_tm->tm_mon], year,
- ! curr_tm->tm_hour, curr_tm->tm_min, curr_tm->tm_sec,
- ! tzsign, tzmin / 60, tzmin % 60, get_tz_name(curr_tm));
-
- ! return buffer;
- }
-
- Index: lib/getword.c
- Prereq: 5.1
- *** ../elm2.4/lib/getword.c Mon Jan 18 23:46:52 1993
- --- lib/getword.c Tue Aug 3 15:28:50 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: getword.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.1 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: getword.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: getword.c,v $
- + * Revision 5.2 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.1 1993/01/19 04:46:21 syd
- * Initial Checkin
- *
- ***************
- *** 20,26 ****
- ******************************************************************************/
-
- #include <stdio.h>
- - #include <ctype.h>
- #include "defs.h"
-
- int get_word(buffer, start, word, wordlen)
- --- 32,37 ----
-
- Index: lib/header_cmp.c
- Prereq: 5.2
- *** ../elm2.4/lib/header_cmp.c Sat Nov 7 15:59:52 1992
- --- lib/header_cmp.c Tue Aug 3 15:28:50 1993
- ***************
- *** 1,7 ****
- ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.2 1992/11/07 20:59:49 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,7 ----
- ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: header_cmp.c,v $
- + * Revision 5.3 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.2 1992/11/07 20:59:49 syd
- * fix typo
- *
- ***************
- *** 32,42 ****
- **/
-
- #include "headers.h"
- - #include <ctype.h>
- -
- - #ifdef BSD
- - #undef tolower
- - #endif
-
-
- char *
- --- 44,49 ----
-
- Index: lib/istrcmp.c
- Prereq: 5.1
- *** ../elm2.4/lib/istrcmp.c Sat Oct 3 18:42:24 1992
- --- lib/istrcmp.c Tue Aug 3 15:28:51 1993
- ***************
- *** 1,7 ****
- ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.1 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,7 ----
- ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: istrcmp.c,v $
- + * Revision 5.2 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.1 1992/10/03 22:41:36 syd
- * Initial checkin as of 2.4 Release at PL0
- *
- ***************
- *** 24,35 ****
- **/
-
- #include "headers.h"
- - #include <ctype.h>
- -
- - #ifdef BSD
- - #undef tolower
- - #endif
- -
-
- int
- istrcmp(s1,s2)
- --- 36,41 ----
- ***************
- *** 38,45 ****
- /* case insensitive comparison */
- register int d;
- for (;;) {
- ! d = ( isupper(*s1) ? tolower(*s1) : *s1 )
- ! - ( isupper(*s2) ? tolower(*s2) : *s2 ) ;
- if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
- return d;
- ++s1;
- --- 44,50 ----
- /* case insensitive comparison */
- register int d;
- for (;;) {
- ! d = (tolower(*s1) - tolower(*s2));
- if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
- return d;
- ++s1;
-
- Index: lib/ldstate.c
- Prereq: 5.5
- *** ../elm2.4/lib/ldstate.c Wed Feb 3 10:26:31 1993
- --- lib/ldstate.c Sun Aug 22 22:46:53 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.5 1993/02/03 15:26:13 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.5 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.6 1993/08/23 02:46:51 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,22 ----
- *
- *******************************************************************************
- * $Log: ldstate.c,v $
- + * Revision 5.6 1993/08/23 02:46:51 syd
- + * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
- + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
- + *
- * Revision 5.5 1993/02/03 15:26:13 syd
- * protect atol in ifndef __STDC__ as some make it a macro, and its in stdlib.h
- *
- ***************
- *** 57,64 ****
- * the (struct folder_state) record.
- */
-
- ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */
- ! extern long atol();
- #endif
-
- static char *elm_fgetline(buf, buflen, fp)
- --- 61,68 ----
- * the (struct folder_state) record.
- */
-
- ! #if !ANSI_C /* avoid problems with systems that declare atol as a macro */
- ! extern long atol();
- #endif
-
- static char *elm_fgetline(buf, buflen, fp)
-
- Index: lib/len_next.c
- Prereq: 5.4
- *** ../elm2.4/lib/len_next.c Sun Apr 11 21:27:30 1993
- --- lib/len_next.c Tue Aug 3 15:28:51 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.4 1993/04/12 01:27:30 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.5 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.5 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: len_next.c,v $
- + * Revision 5.5 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.4 1993/04/12 01:27:30 syd
- * len_next_part() was botching quote-delimited strings.
- * From: chip@chinacat.unicom.com (Chip Rosenthal)
- ***************
- *** 54,61 ****
-
- **/
-
- - #include <ctype.h>
- -
-
- int
- len_next_part(str)
- --- 66,71 ----
-
- Index: lib/mail_gets.c
- Prereq: 5.2
- *** ../elm2.4/lib/mail_gets.c Sun Apr 11 21:13:30 1993
- --- lib/mail_gets.c Tue Aug 3 15:28:52 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.2 1993/04/12 01:13:30 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
- *
- * Copyright (c) 1992 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,39 ----
- *
- *******************************************************************************
- * $Log: mail_gets.c,v $
- + * Revision 5.4 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- + * Revision 5.3 1993/08/03 19:05:33 syd
- + * When STDC is used on Convex the feof() function is defined as
- + * a true library routine in the header files and moreover the
- + * library routine also leaks royally. It returns always 1!!
- + * So we have to use a macro. Convex naturally does not provide
- + * you with one though if you are using a STDC compiler. So we
- + * have to include one.
- + * From: Jukka Ukkonen <ukkonen@csc.fi>
- + *
- * Revision 5.2 1993/04/12 01:13:30 syd
- * In some cases, with certain editors, the user can create an
- * aliases.text file in which the last line is terminated with an EOF but
- ***************
- *** 33,40 ****
- **/
-
- #include <stdio.h>
- ! #include <ctype.h>
- !
-
- int
- mail_gets(buffer, size, mailfile)
- --- 54,60 ----
- **/
-
- #include <stdio.h>
- ! #include "defs.h"
-
- int
- mail_gets(buffer, size, mailfile)
- ***************
- *** 46,51 ****
- --- 66,72 ----
- register char *c = buffer;
-
- size--; /* allow room for zero terminator on end, just in case */
- +
- while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) {
- ch = getc(mailfile); /* Macro, faster than fgetc() ! */
-
-
- Index: lib/mcprt.c
- *** ../elm2.4/lib/mcprt.c Sat Oct 3 18:42:25 1992
- --- lib/mcprt.c Sun Aug 22 22:49:36 1993
- ***************
- *** 1,4 ****
- --- 1,6 ----
-
- + static char rcsid[] = "@(#)$Id: mcprt.c,v 5.5 1993/08/23 02:49:35 syd Exp $";
- +
- /***********************************************************
- Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
-
- ***************
- *** 35,41 ****
-
- 01/18/91 3 hamilton #if not rescanned
- 01/12/91 1 schulert conditionally use prototypes
- ! rework to use either varargs or stdargs
- 11/03/90 2 hamilton Alphalpha->Alfalfa & OmegaMail->Poste
- 08/10/90 1 nazgul printf, sprintf and fprintf
- */
- --- 37,43 ----
-
- 01/18/91 3 hamilton #if not rescanned
- 01/12/91 1 schulert conditionally use prototypes
- ! rework to use either varargs or stdarg
- 11/03/90 2 hamilton Alphalpha->Alfalfa & OmegaMail->Poste
- 08/10/90 1 nazgul printf, sprintf and fprintf
- */
- ***************
- *** 47,55 ****
- --- 49,61 ----
- #include "mcprt.h"
- #include "mcprtlib.h"
-
- + #ifdef I_STDARG
- + int MCprintf(char *fmt, ...)
- + #else
- int MCprintf(fmt, va_alist)
- char *fmt;
- va_dcl
- + #endif
- {
- MCRockT *rock;
- int len, i;
- ***************
- *** 65,74 ****
- --- 71,84 ----
- return len;
- }
-
- + #ifdef I_STDARG
- + int MCfprintf(FILE *fptr, char *fmt, ...)
- + #else
- int MCfprintf(fptr, fmt, va_alist)
- FILE *fptr;
- char *fmt;
- va_dcl
- + #endif
- {
- MCRockT *rock;
- int len, i;
- ***************
- *** 84,93 ****
- --- 94,107 ----
- return len;
- }
-
- + #ifdef I_STDARG
- + int MCsprintf(char *cptr, char *fmt, ...)
- + #else
- int MCsprintf(cptr, fmt, va_alist)
- char *cptr;
- char *fmt;
- va_dcl
- + #endif
- {
- MCRockT *rock;
- int len, i;
-
- Index: lib/mcprtlib.c
- *** ../elm2.4/lib/mcprtlib.c Sat Oct 3 18:42:26 1992
- --- lib/mcprtlib.c Sun Aug 22 22:54:32 1993
- ***************
- *** 1,4 ****
- --- 1,6 ----
-
- + static char rcsid[] = "@(#)$Id: mcprtlib.c,v 5.5 1993/08/23 02:54:31 syd Exp $";
- +
- /***********************************************************
- Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
-
- ***************
- *** 47,53 ****
- #define CATGETS
-
- #include <stdio.h>
- - #include <ctype.h>
- #include "defs.h"
-
- #include "mcprtlib.h"
- --- 49,54 ----
- ***************
- *** 292,297 ****
- --- 293,302 ----
- * Set the correct types and figure out how many data segments we are going
- * to have.
- */
- + /* Initialize typeList */
- + for (i = 0; i < typeCnt; i++)
- + typeList[i].type = 0;
- +
- for (replyCnt = i = 0; i < argCnt; ++i) {
- if (argList[i].type) {
- pos = argList[i].pos-1;
- ***************
- *** 580,586 ****
- if (rock->typeList) free((char *) rock->typeList);
-
- if (rock->replyList) {
- ! for (i = 0; i < rock->argCnt; ++i) {
- if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
- free(rock->replyList[i].data);
- }
- --- 585,591 ----
- if (rock->typeList) free((char *) rock->typeList);
-
- if (rock->replyList) {
- ! for (i = 0; i < rock->replyCnt; ++i) {
- if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
- free(rock->replyList[i].data);
- }
-
- Index: lib/mk_aliases.c
- Prereq: 5.12
- *** ../elm2.4/lib/mk_aliases.c Sat May 8 16:25:34 1993
- --- lib/mk_aliases.c Tue Aug 3 15:28:53 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.12 1993/05/08 20:25:33 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.15 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,40 ----
- *
- *******************************************************************************
- * $Log: mk_aliases.c,v $
- + * Revision 5.15 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- + * Revision 5.14 1993/07/20 02:59:53 syd
- + * Support aliases both on 64 bit and 32 bit machines at the same time.
- + * From: Dan Mosedale <mosedale@genome.stanford.edu>
- + *
- + * Revision 5.13 1993/07/20 01:45:56 syd
- + * When resyncing aliases from elm, and there was aliases to delete,
- + * the alias.pag file could be corrupted since file_offset wasn't set to zero.
- + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
- + *
- * Revision 5.12 1993/05/08 20:25:33 syd
- * Add sleepmsg to control transient message delays
- * From: Syd
- ***************
- *** 110,122 ****
-
- #include "headers.h"
- #include "s_newalias.h"
- - #include <ctype.h>
- #include "ndbz.h"
-
- #ifdef BSD
- # include <sys/file.h>
- - # undef tolower
- - # undef toupper
- #endif
-
- #define group(string) (index(string,',') != NULL)
- --- 131,140 ----
- ***************
- *** 278,287 ****
- int
- add_to_hash_table(word, offset)
- char *word;
- ! long offset;
- {
- datum key, value, ovalue;
- ! long off;
-
- key.dptr = word;
- key.dsize = strlen(word);
- --- 296,305 ----
- int
- add_to_hash_table(word, offset)
- char *word;
- ! int32 offset;
- {
- datum key, value, ovalue;
- ! int32 off;
-
- key.dptr = word;
- key.dsize = strlen(word);
- ***************
- *** 320,326 ****
- FILE *data;
- register char *aliases, *lastn, *firstn, *comment, *addresses;
- {
- ! struct alias_rec alias;
- register char *s;
- /*
- * crack the information into an alias_rec structure, then add the entry
- --- 338,344 ----
- FILE *data;
- register char *aliases, *lastn, *firstn, *comment, *addresses;
- {
- ! struct alias_disk_rec alias;
- register char *s;
- /*
- * crack the information into an alias_rec structure, then add the entry
- ***************
- *** 357,363 ****
- * Only add an entry if we could add it to the hash table.
- * (no errors or duplicates)
- */
- ! if (add_to_hash_table(aliases, file_offset+sizeof(alias)) == 0) {
- file_offset += alias.length + sizeof(alias);
- /*
- * Write the entry to the data file, followed by its data
- --- 375,382 ----
- * Only add an entry if we could add it to the hash table.
- * (no errors or duplicates)
- */
- ! if (add_to_hash_table(aliases, (int32)(file_offset+sizeof(alias)))
- ! == 0) {
- file_offset += alias.length + sizeof(alias);
- /*
- * Write the entry to the data file, followed by its data
- ***************
- *** 714,719 ****
- --- 733,739 ----
- buff_loaded = 0; /* file buffer empty right now! */
- al_count = 0;
- err_flag = 0;
- + file_offset = 0;
-
- while (get_alias(in, fromelm) != -1) {
- put_alias(data);
-
- Index: lib/msgcat.c
- *** ../elm2.4/lib/msgcat.c Sun Apr 11 23:22:31 1993
- --- lib/msgcat.c Wed Jun 9 23:12:20 1993
- ***************
- *** 1,3 ****
- --- 1,6 ----
- +
- + static char rcsid[] = "@(#)$Id: msgcat.c,v 5.2 1993/06/10 03:12:10 syd Exp $";
- +
- /* -*- c++ -*- */
-
- /***********************************************************
-
- Index: lib/ndbz.c
- Prereq: 5.6
- *** ../elm2.4/lib/ndbz.c Sun Apr 11 23:22:31 1993
- --- lib/ndbz.c Sun Aug 22 22:46:55 1993
- ***************
- *** 1,7 ****
- ! static char rcsid[] = "@(#)$Id: ndbz.c,v 5.6 1993/02/08 00:18:11 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,7 ----
- ! static char rcsid[] = "@(#)$Id: ndbz.c,v 5.11 1993/08/23 02:46:51 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.11 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 13,18 ****
- --- 13,47 ----
- *
- *******************************************************************************
- * $Log: ndbz.c,v $
- + * Revision 5.11 1993/08/23 02:46:51 syd
- + * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
- + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
- + *
- + * Revision 5.10 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- + * Revision 5.9 1993/08/03 19:22:01 syd
- + * Add proper casts to free() calls to suppress warnings.
- + * Properly cast return types.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- + * Revision 5.8 1993/07/20 02:59:53 syd
- + * Support aliases both on 64 bit and 32 bit machines at the same time.
- + * From: Dan Mosedale <mosedale@genome.stanford.edu>
- + *
- + * Revision 5.7 1993/06/09 23:41:34 syd
- + * Add frees of db structure on failed dbz_open
- + * From: Syd
- + *
- * Revision 5.6 1993/02/08 00:18:11 syd
- * fix taghere to be || instead of | and paren to make
- * it catch duplicates again, as per testing.
- ***************
- *** 74,80 ****
- */
-
- #include "headers.h"
- - #include <ctype.h>
- #include <errno.h>
- #ifndef ANSI_C
- extern int errno;
- --- 103,108 ----
- ***************
- *** 194,200 ****
- #endif
-
- static int getconf();
- ! static long getno();
- static int putconf();
- static void mybytemap();
- static of_t bytemap();
- --- 222,228 ----
- #endif
-
- static int getconf();
- ! static int32 getno();
- static int putconf();
- static void mybytemap();
- static of_t bytemap();
- ***************
- *** 246,252 ****
- #define MAPOUT(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))
-
- /* externals used */
- ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */
- extern long atol();
- #endif
-
- --- 274,280 ----
- #define MAPOUT(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))
-
- /* externals used */
- ! #if !ANSI_C /* avoid problems with systems that declare atol as a macro */
- extern long atol();
- #endif
-
- ***************
- *** 282,293 ****
-
- if (size != 0 && size < 2) {
- dprint(5, (debugfile, "dbz_fresh: preposterous size (%ld)\n", size));
- ! return(NULL);
- }
-
- /* get default configuration */
- if (getconf((FILE *)NULL, (FILE *)NULL, &c) < 0)
- ! return(NULL); /* "can't happen" */
-
- /* and mess with it as specified */
- if (size != 0)
- --- 310,321 ----
-
- if (size != 0 && size < 2) {
- dprint(5, (debugfile, "dbz_fresh: preposterous size (%ld)\n", size));
- ! return (DBZ *)NULL;
- }
-
- /* get default configuration */
- if (getconf((FILE *)NULL, (FILE *)NULL, &c) < 0)
- ! return (DBZ *)NULL; /* "can't happen" */
-
- /* and mess with it as specified */
- if (size != 0)
- ***************
- *** 316,346 ****
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- ! return(NULL);
- f = fopen(fn, "w");
- ! free(fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_fresh: unable to write config\n"));
- ! return(NULL);
- }
- if (putconf(f, &c) < 0) {
- (void) fclose(f);
- ! return(NULL);
- }
- if (fclose(f) == EOF) {
- dprint(5, (debugfile, "dbz_fresh: fclose failure\n"));
- ! return(NULL);
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- ! return(NULL);
- f = fopen(fn, "w");
- ! free(fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_fresh: unable to create/truncate .pag file\n"));
- ! return(NULL);
- } else
- (void) fclose(f);
-
- --- 344,374 ----
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- ! return (DBZ *)NULL;
- f = fopen(fn, "w");
- ! free((malloc_t)fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_fresh: unable to write config\n"));
- ! return (DBZ *)NULL;
- }
- if (putconf(f, &c) < 0) {
- (void) fclose(f);
- ! return (DBZ *)NULL;
- }
- if (fclose(f) == EOF) {
- dprint(5, (debugfile, "dbz_fresh: fclose failure\n"));
- ! return (DBZ *)NULL;
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- ! return (DBZ *)NULL;
- f = fopen(fn, "w");
- ! free((malloc_t)fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_fresh: unable to create/truncate .pag file\n"));
- ! return (DBZ *)NULL;
- } else
- (void) fclose(f);
-
- ***************
- *** 426,443 ****
- /* pick up the old configuration */
- fn = enstring(oldname, dir);
- if (fn == NULL)
- ! return(NULL);
- f = fopen(fn, "r");
- ! free(fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: cannot open old .dir file\n"));
- ! return(NULL);
- }
- i = getconf(f, (FILE *)NULL, &c);
- (void) fclose(f);
- if (i < 0) {
- dprint(5, (debugfile, "dbz_again: getconf failed\n"));
- ! return(NULL);
- }
-
- /* tinker with it */
- --- 454,471 ----
- /* pick up the old configuration */
- fn = enstring(oldname, dir);
- if (fn == NULL)
- ! return (DBZ *)NULL;
- f = fopen(fn, "r");
- ! free((malloc_t)fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: cannot open old .dir file\n"));
- ! return (DBZ *)NULL;
- }
- i = getconf(f, (FILE *)NULL, &c);
- (void) fclose(f);
- if (i < 0) {
- dprint(5, (debugfile, "dbz_again: getconf failed\n"));
- ! return (DBZ *)NULL;
- }
-
- /* tinker with it */
- ***************
- *** 463,491 ****
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- ! return(NULL);
- f = fopen(fn, "w");
- ! free(fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: unable to write new .dir\n"));
- ! return(NULL);
- }
- i = putconf(f, &c);
- (void) fclose(f);
- if (i < 0) {
- dprint(5, (debugfile, "dbz_again: putconf failed\n"));
- ! return(NULL);
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- ! return(NULL);
- f = fopen(fn, "w");
- ! free(fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: unable to create/truncate .pag file\n"));
- ! return(NULL);
- } else
- (void) fclose(f);
-
- --- 491,519 ----
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- ! return (DBZ *)NULL;
- f = fopen(fn, "w");
- ! free((malloc_t)fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: unable to write new .dir\n"));
- ! return (DBZ *)NULL;
- }
- i = putconf(f, &c);
- (void) fclose(f);
- if (i < 0) {
- dprint(5, (debugfile, "dbz_again: putconf failed\n"));
- ! return (DBZ *)NULL;
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- ! return (DBZ *)NULL;
- f = fopen(fn, "w");
- ! free((malloc_t)fn);
- if (f == NULL) {
- dprint(5, (debugfile, "dbz_again: unable to create/truncate .pag file\n"));
- ! return (DBZ *)NULL;
- } else
- (void) fclose(f);
-
- ***************
- *** 512,540 ****
-
- if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
- dprint(5, (debugfile, "dbz_open: no room for DBZ structure\n"));
- ! return(NULL);
- }
- /* open the .dir file */
- dirfname = enstring(name, dir);
- ! if (dirfname == NULL)
- ! return(NULL);
-
- if (mode == O_RDONLY) {
- db->dbz_dirf = fopen(dirfname, "r");
- db->dbz_dirronly = 1;
- } else
- db->dbz_dirf = fopen(dirfname, "r+");
- ! free(dirfname);
- if (db->dbz_dirf == NULL) {
- dprint(5, (debugfile, "dbz_open: can't open .dir file\n"));
- ! return(NULL);
- }
-
- /* open the .pag file */
- pagfname = enstring(name, pag);
- if (pagfname == NULL) {
- (void) fclose(db->dbz_dirf);
- ! return(NULL);
- }
- if (mode == O_RDONLY) {
- db->dbz_pagf = fopen(pagfname, "rb");
- --- 540,573 ----
-
- if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
- dprint(5, (debugfile, "dbz_open: no room for DBZ structure\n"));
- ! return (DBZ *)NULL;
- }
- /* open the .dir file */
- dirfname = enstring(name, dir);
- ! if (dirfname == NULL) {
- ! free((malloc_t)db);
- ! return (DBZ *)NULL;
- ! }
-
- if (mode == O_RDONLY) {
- db->dbz_dirf = fopen(dirfname, "r");
- db->dbz_dirronly = 1;
- } else
- db->dbz_dirf = fopen(dirfname, "r+");
- ! free((malloc_t)dirfname);
- !
- if (db->dbz_dirf == NULL) {
- dprint(5, (debugfile, "dbz_open: can't open .dir file\n"));
- ! free((malloc_t)db);
- ! return (DBZ *)NULL;
- }
-
- /* open the .pag file */
- pagfname = enstring(name, pag);
- if (pagfname == NULL) {
- (void) fclose(db->dbz_dirf);
- ! free((malloc_t)db);
- ! return (DBZ *)NULL;
- }
- if (mode == O_RDONLY) {
- db->dbz_pagf = fopen(pagfname, "rb");
- ***************
- *** 545,552 ****
- if (db->dbz_pagf == NULL) {
- dprint(5, (debugfile, "dbz_open: .pag open failed\n"));
- (void) fclose(db->dbz_dirf);
- ! free(pagfname);
- ! return(NULL);
- }
- #ifdef NOBUFFER
- /*
- --- 578,586 ----
- if (db->dbz_pagf == NULL) {
- dprint(5, (debugfile, "dbz_open: .pag open failed\n"));
- (void) fclose(db->dbz_dirf);
- ! free((malloc_t)pagfname);
- ! free((malloc_t)db);
- ! return (DBZ *)NULL;
- }
- #ifdef NOBUFFER
- /*
- ***************
- *** 572,579 ****
- if (db->dbz_basefname == NULL) {
- (void) fclose(db->dbz_pagf);
- (void) fclose(db->dbz_dirf);
- ! free(pagfname);
- ! return(NULL);
- }
- } else
- db->dbz_basefname = NULL;
- --- 606,614 ----
- if (db->dbz_basefname == NULL) {
- (void) fclose(db->dbz_pagf);
- (void) fclose(db->dbz_dirf);
- ! free((malloc_t)pagfname);
- ! free((malloc_t)db);
- ! return (DBZ *)NULL;
- }
- } else
- db->dbz_basefname = NULL;
- ***************
- *** 589,597 ****
- (void) fclose(db->dbz_pagf);
- (void) fclose(db->dbz_basef);
- (void) fclose(db->dbz_dirf);
- ! free(pagfname);
- errno = EDOM; /* kind of a kludge, but very portable */
- ! return(NULL);
- }
- db->dbz_tagbits = db->dbz_conf.tagmask << db->dbz_conf.tagshift;
- db->dbz_taghere = db->dbz_conf.tagenb << db->dbz_conf.tagshift;
- --- 624,633 ----
- (void) fclose(db->dbz_pagf);
- (void) fclose(db->dbz_basef);
- (void) fclose(db->dbz_dirf);
- ! free((malloc_t)pagfname);
- ! free((malloc_t)db);
- errno = EDOM; /* kind of a kludge, but very portable */
- ! return (DBZ *)NULL;
- }
- db->dbz_tagbits = db->dbz_conf.tagmask << db->dbz_conf.tagshift;
- db->dbz_taghere = db->dbz_conf.tagenb << db->dbz_conf.tagshift;
- ***************
- *** 613,619 ****
- db->dbz_bufpagf = NULL;
- db->dbz_corepag = NULL;
- }
- ! free(pagfname);
-
- /* misc. setup */
- crcinit();
- --- 649,655 ----
- db->dbz_bufpagf = NULL;
- db->dbz_corepag = NULL;
- }
- ! free((malloc_t)pagfname);
-
- /* misc. setup */
- crcinit();
- ***************
- *** 668,681 ****
- ret = -1;
- }
- if (db->dbz_corepag != NULL)
- ! free((char *)db->dbz_corepag);
- db->dbz_corepag = NULL;
- if (fclose(db->dbz_basef) == EOF) {
- dprint(5, (debugfile, "dbz_close: fclose(basef) failed\n"));
- ret = -1;
- }
- if (db->dbz_basefname != NULL)
- ! free(db->dbz_basefname);
- db->dbz_basef = NULL;
- db->dbz_pagf = NULL;
- if (fclose(db->dbz_dirf) == EOF) {
- --- 704,717 ----
- ret = -1;
- }
- if (db->dbz_corepag != NULL)
- ! free((malloc_t)db->dbz_corepag);
- db->dbz_corepag = NULL;
- if (fclose(db->dbz_basef) == EOF) {
- dprint(5, (debugfile, "dbz_close: fclose(basef) failed\n"));
- ret = -1;
- }
- if (db->dbz_basefname != NULL)
- ! free((malloc_t)db->dbz_basefname);
- db->dbz_basef = NULL;
- db->dbz_pagf = NULL;
- if (fclose(db->dbz_dirf) == EOF) {
- ***************
- *** 683,689 ****
- ret = -1;
- }
-
- ! free((char *) db);
-
- dprint(5, (debugfile, "dbz_close: %s\n", (ret == 0) ? "succeeded" : "failed"));
- return(ret);
- --- 719,725 ----
- ret = -1;
- }
-
- ! free((malloc_t) db);
-
- dprint(5, (debugfile, "dbz_close: %s\n", (ret == 0) ? "succeeded" : "failed"));
- return(ret);
- ***************
- *** 829,842 ****
-
- if (db->dbz_basefname == NULL) {
- dprint(5, (debugfile, "latebase: name foulup\n"));
- ! return(NULL);
- }
- it = fopen(db->dbz_basefname, "r");
- if (it == NULL) {
- dprint(5, (debugfile, "latebase: still can't open base\n"));
- } else {
- dprint(5, (debugfile, "latebase: late open succeeded\n"));
- ! free(db->dbz_basefname);
- db->dbz_basefname = NULL;
- #ifdef _IOFBF
- (void) setvbuf(it, db->dbz_basebuf, _IOFBF, sizeof(db->dbz_basebuf));
- --- 865,878 ----
-
- if (db->dbz_basefname == NULL) {
- dprint(5, (debugfile, "latebase: name foulup\n"));
- ! return (FILE *)NULL;
- }
- it = fopen(db->dbz_basefname, "r");
- if (it == NULL) {
- dprint(5, (debugfile, "latebase: still can't open base\n"));
- } else {
- dprint(5, (debugfile, "latebase: late open succeeded\n"));
- ! free((malloc_t)db->dbz_basefname);
- db->dbz_basefname = NULL;
- #ifdef _IOFBF
- (void) setvbuf(it, db->dbz_basebuf, _IOFBF, sizeof(db->dbz_basebuf));
- ***************
- *** 988,996 ****
- }
-
- /*
- ! - getno - get a long
- */
- ! static long
- getno(f, ep)
- FILE *f;
- int *ep;
- --- 1024,1032 ----
- }
-
- /*
- ! - getno - get an int32
- */
- ! static int32
- getno(f, ep)
- FILE *f;
- int *ep;
- ***************
- *** 1023,1029 ****
- dprint(5, (debugfile, "getno: `%s' non-numeric\n", getbuf));
- *ep = -1;
- }
- ! return(atol(getbuf));
- }
-
- /*
- --- 1059,1066 ----
- dprint(5, (debugfile, "getno: `%s' non-numeric\n", getbuf));
- *ep = -1;
- }
- !
- ! return((int32)atol(getbuf));
- }
-
- /*
- ***************
- *** 1073,1086 ****
- it = malloc((size_t)db->dbz_conf.tsize * SOF);
- if (it == NULL) {
- dprint(5, (debugfile, "getcore: malloc failed\n"));
- ! return(NULL);
- }
-
- nread = fread(it, SOF, (size_t)db->dbz_conf.tsize, db->dbz_bufpagf);
- if (ferror(db->dbz_bufpagf)) {
- dprint(5, (debugfile, "getcore: read failed\n"));
- ! free(it);
- ! return(NULL);
- }
-
- p = (of_t *)it + nread;
- --- 1110,1123 ----
- it = malloc((size_t)db->dbz_conf.tsize * SOF);
- if (it == NULL) {
- dprint(5, (debugfile, "getcore: malloc failed\n"));
- ! return (of_t *)NULL;
- }
-
- nread = fread(it, SOF, (size_t)db->dbz_conf.tsize, db->dbz_bufpagf);
- if (ferror(db->dbz_bufpagf)) {
- dprint(5, (debugfile, "getcore: read failed\n"));
- ! free((malloc_t)it);
- ! return (of_t *)NULL;
- }
-
- p = (of_t *)it + nread;
-
- Index: lib/opt_utils.c
- Prereq: 5.7
- *** ../elm2.4/lib/opt_utils.c Tue Jan 19 22:02:34 1993
- --- lib/opt_utils.c Tue Aug 3 16:11:44 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: opt_utils.c,v 5.7 1993/01/20 03:02:19 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: opt_utils.c,v 5.8 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ***************
- *** 14,19 ****
- --- 14,31 ----
- *
- *******************************************************************************
- * $Log: opt_utils.c,v $
- + * Revision 5.8 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.7 1993/01/20 03:02:19 syd
- * Move string declarations to defs.h
- * From: Syd
- ***************
- *** 57,63 ****
-
- #include "headers.h"
- #include "s_error.h"
- - #include <ctype.h>
-
- #ifdef PWDINSYS
- # include <sys/pwd.h>
- --- 69,74 ----
- ***************
- *** 65,75 ****
- # include <pwd.h>
- #endif
-
- - #ifdef BSD
- - #undef tolower
- - #undef toupper
- - #endif
- -
- #ifndef GETHOSTNAME
- # ifdef DOUNAME
- # include <sys/utsname.h>
- --- 76,81 ----
- ***************
- *** 217,251 ****
-
- #endif
-
- - #if defined(BSD) && !defined(_POSIX_SOURCE)
- -
- - /** some supplementary string functions for Berkeley Unix systems **/
- -
- - int
- - tolower(ch)
- - int ch;
- - {
- - /** This should be a macro call, but if you use this as a macro
- - calls to 'tolower' where the argument is a function call will
- - cause the function to be called TWICE which is obviously the
- - wrong behaviour. On the other hand, to just blindly translate
- - assuming the character is always uppercase can cause BIG
- - problems, so...
- - **/
- -
- - return ( isupper(ch) ? ch - 'A' + 'a' : ch );
- - }
- -
- - int
- - toupper(ch)
- - int ch;
- - {
- - /** see comment for above routine - tolower() **/
- -
- - return ( islower(ch) ? ch - 'a' + 'A' : ch );
- - }
- -
- - #endif
-
- #ifndef STRTOK
-
- --- 223,228 ----
-
- Index: lib/parsarpdat.c
- Prereq: 5.2
- *** ../elm2.4/lib/parsarpdat.c Sun Apr 11 22:16:33 1993
- --- lib/parsarpdat.c Tue Aug 3 15:28:55 1993
- ***************
- *** 1,8 ****
-
- ! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 5.2 1993/04/12 02:16:32 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- --- 1,8 ----
-
- ! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
-
- /*******************************************************************************
- ! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
- *
- * Copyright (c) 1993 USENET Community Trust
- *******************************************************************************
- ***************
- *** 13,18 ****
- --- 13,30 ----
- *
- *******************************************************************************
- * $Log: parsarpdat.c,v $
- + * Revision 5.3 1993/08/03 19:28:39 syd
- + * Elm tries to replace the system toupper() and tolower() on current
- + * BSD systems, which is unnecessary. Even worse, the replacements
- + * collide during linking with routines in isctype.o. This patch adds
- + * a Configure test to determine whether replacements are really needed
- + * (BROKE_CTYPE definition). The <ctype.h> header file is now included
- + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- + * there. Inclusion of <ctype.h> was removed from *all* the individual
- + * files, and the toupper() and tolower() routines in lib/opt_utils.c
- + * were dropped.
- + * From: chip@chinacat.unicom.com (Chip Rosenthal)
- + *
- * Revision 5.2 1993/04/12 02:16:32 syd
- * Fix year handling bug in date(1) time formats.
- * From: chip@chinacat.unicom.com (Chip Rosenthal)
- ***************
- *** 25,31 ****
-
-
- #include "headers.h"
- - #include <ctype.h>
-
-
- /*
- --- 37,42 ----
-
-